//index.js
//获取应用实例
const app = getApp();

Page({
  data: {
    swiperList: [{
      id: 0,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg'
    }, {
      id: 1,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
    }, {
      id: 2,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
    }, {
      id: 3,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
    }, {
      id: 4,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
    }, {
      id: 5,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
    }, {
      id: 6,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
    }],
    roomDate: [
      {
        title: '100万以内优选',
        swiperContent: [{
          id: 0,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国~CHAMBERS ON NUT 钱伯斯公馆',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 1,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 2,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 3,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 4,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 5,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 6,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }],
        selectLable: ['100万以下', '100万以下', '100万以下', '100万以下']
      },
      {
        title: '高租金收益楼盘',
        swiperContent: [{
          id: 0,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国~CHAMBERS ON NUT 钱伯斯公馆',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 1,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 2,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 3,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 4,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 5,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 6,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }],
        selectLable: ['商业地产', '联排别墅', '独栋别墅', '商品房']
      },
      {
        title: '低首付优质房源',
        swiperContent: [{
          id: 0,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国~CHAMBERS ON NUT 钱伯斯公馆',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 1,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 2,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 3,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 4,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 5,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 6,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }],
        selectLable: ['旅游度假', '投资理财', '教育留学', '生活自住']
      },
      {
        title: '最具升值潜力房源',
        swiperContent: [{
          id: 0,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国~CHAMBERS ON NUT 钱伯斯公馆',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 1,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 2,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 3,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 4,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 5,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }, {
          id: 6,
          type: 'image',
          url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
          name: '超高性价比爆款公寓,距离啊啊啊啊啊',
          tip: '泰国啊啊啊啊啊啊',
          oneNum: '6',
          twoNum: '11',
          ThreeNum: '30'
        }],
        selectLable: ['1室', '2室', '3室', '4室']
      },
    ],
    swiperCurrent: 0,
    swiperCityCurrent: 0,
    swiperThemeCurrent: 0,
    tabHeight: 0,
    opice: 'rgba(255,255,255,0)',
  },
  onLoad: function (option) {
    let that = this;
    that.setData({
      tabHeight: app.globalData.tabBarHeight
    })
  },
  goFindRoom: function (e) {
    app.globalData.indexSearchTabs = e.currentTarget.dataset.tab
    wx.switchTab({
      url: '/pages/findhouse/findhouse',
    });
  },
  goNewHouseDetails: function(e) {
    wx.navigateTo({
      url: '/pages/newhousedetails/newhousedetails',
    })
  },
  swiperHomeChange: function (e) {
    let current = e.detail.current;
    let that = this;
    that.setData({
      swiperCurrent: current,
    })
  },
  swiperCityChange: function (e) {
    let current = e.detail.current;
    let that = this;
    that.setData({
      swiperCityCurrent: current
    });
  },
  swiperThemeChange: function (e) {
    let current = e.detail.current;
    let that = this;
    that.setData({
      swiperThemeCurrent: current
    });
  },

  // 考察investigate
  goInvestigate(e) {
    wx.navigateTo({
      url: '/pages/investigate/investigate',
    })
  },
  // 免费找房
  goHelpRoom(e) {
    wx.navigateTo({
      url: '/pages/helproom/helproom',
    })
  },
  //交流群
  goCommunicationGroup(e) {
    wx.navigateTo({
      url: '/pages/communicationgroup/communicationgroup',
    })
  },
  // 热门主题
  hotTopics(e) {
    wx.navigateTo({
      url: '/pages/hottopics/hottopics',
    })
  },
  //房产专题 
  goEstatetheme(e) {
    wx.navigateTo({
      url: '/pages/estatetheme/estatetheme',
    })
  },
  onPageScroll(e) {
    let num = e.scrollTop / 100;
    let opice;
    num >= 1 ? opice = 'rgba(255,255,255,1)' : opice = 'rgba(255,255,255,' + num + ')';
    this.setData({
      opice: opice
    })
  }
})
